<?php

namespace App\Http\Requests\User\Personal;

use Illuminate\Foundation\Http\FormRequest;

class InspectionRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
		return [
			'project_id' => 'required',
			'node_id' => 'required',
			'longitude' => 'required',
			'latitude' => 'required',
			'example' => 'required',
			'images' => 'required|array',
		];
    }

	/**
	 * 定义表单验证提示信息
	 *
	 * Date: 25/04/2018
	 * @author George
	 * @return array
	 */
	public function messages()
	{
		return [
			'project_id.required' => '请选择项目',
			'node_id.required' => '请选择节点',
			'longitude.required' => '缺少经度信息',
			'latitude.required' => '缺少纬度信息',
			'example.required' => '缺少示例图ID',
			'images.required' => '请上传巡检图片',
			'images.array' => '缺少图片信息',
		];
	}
}
